Outsourcing the Graphical Input/Output using Streams and Haskell
نویسنده
چکیده
This paper presents a generalized system for graphical IO that views the graphical environment as a separate IO device, for Haskell and other functional languages. Haskell uses monads in its IO system but these are considered difficult and stimulate an imperative way of thinking. This paper shows why an implementation of the so-called stream model provides a solution to these problems. We demonstrate the feasibility of the generalized system and how it can be used to achieve platform-independent graphical IO, by presenting a prototype system that uses the generalized system, and the graphical capabilities of a browser as the graphical IO device. By viewing the browser as a more complex IO device, it is also possible to use it’s keyboard and mouse information-capturing features and communicate them to the program along the same IO connection as the graphical IO.
منابع مشابه
Upper Bounds on Stream I/O Using Semantic Interpretations
This paper extends for the first time semantic interpretation tools to infinite data in order to ensure Input/Output upper bounds on first order Haskell like programs on streams. By I/O upper bounds, we mean temporal relations between the number of reads performed on the input stream elements and the number of output elements produced. We study several I/O upper bounds properties that are of bo...
متن کاملA Monad of Imperative Streams
A new approach is presented for performing concurrent I/O in a functional programming language. A new monad St is introduced which generalizes Haskell's IO monad: A value of type St a represents an imperative program which, at certain times during its execution, will produce a value of type a. In contrast, a value of type IO a represents an imperative program which, at the end of its execution,...
متن کاملDebugging Reactive Systems in Haskell
We support the use of Haskell in two classes of applications. First, we note that although Haskell is well-suited for stream-oriented applications, like reactive systems, most implementations lack tools for locating subtle errors like deadlocks. To support the use of Haskell in such applications, we have designed and implemented a debugger with an intuitive graphical interface. The debugger sim...
متن کاملPictures : A simple structured graphics
We present in this paper a simple graphical model for describing graphics using a functional language. Two-dimensional graphical scenes are represented using a recursive data type, where pictures are constructed by repeatedly composing smaller pictures together. The model is device-independent and provides the basic capabilities of a purely functional page description language. One novel aspect...
متن کاملPicture: A Simple Structured Graphics Model
We present in this paper a simple, device-independent model for describing two-dimensional graphics using a functional language. Graphical scenes, or pictures, are represented as values that functions can manipulate and inspect to create new values. Complete pictures are constructed by repeatedly composing such picture values together using picture com-binators. A novel aspect of the model pres...
متن کامل